package com.zpark.resume.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @PackageName: com.zpark.resume.config
 * @ClassName: FileUploadConfig
 * @Description:
 * @author: RZS
 * @date: 2023/6/1  14:46
 */
@Configuration
public class FileUploadConfig implements WebMvcConfigurer {

    @Value("${img.path}")
    private String path;
    @Value("${honor.path}")
    private String honorPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/upload/**")
                .addResourceLocations(path);
        registry.addResourceHandler("/honor/**")
                .addResourceLocations(honorPath);
    }
}
